<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://www.zkingsoft.com" prefix="matrix"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/plugin/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<!-- 搜索框部分start -->
	<div class="row" >
		<div class="col-sm-12" >
			<form class="form-inline" id="serchform">
				<div class="input-group" >
					<div class="form-group mr-20">
						<input id="search-text" name="authName" placeholder="输入查询关键词" type="text" class="form-control">
					</div>
					<div class="form-group mr-20">
						<button  onclick="myGrid.serchData()" type="button" class="btn btn-info"><i class="fa fa-search " ></i> 搜索</button>
						<button  type="reset" class="btn btn-info "><i class="fa fa-refresh " ></i> 重置</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<!-- 搜索框部分en -->
<div class="ibox-content radius-5 mt-5 mpanel">
		
	<div class="row" >
		<div class="col-sm-12" >
		<div class="option-bar" >
				<button  onclick="myGrid.delItems('id')" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i>批量删除</button>
				<button onclick="openAdd()" type="button" class="btn btn-success btn-sm"><i class="fa fa-plus" ></i>  新增</button>
			</div>
			<table id="mgrid" >
				<thead>
					<tr>
						<th data-checkbox="true"  ></th>
						<th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th>
						<th data-field="authName" data-sortable="true">真实姓名</th>
						<th data-field="authPhone"  >手机号</th>
						<th data-field="authLicenseType">认证类型</th>
						<th data-field="authStatus" data-formatter="authStatus"  >认证状态</th>
						<th data-field="authRemark"   >备注</th>
						<th data-field="authExpirationTime" data-formatter="MGrid.getTime"  >到期时间</th>
						<th data-field="authCompany"    >企业全称</th>
						<th data-field="authLicense"    >营业执照</th>
						<th data-field="authIdCardPositive" data-formatter="MGrid.getImage"  >身份证正面照</th>
						<th data-field="authIdCardNegative" data-formatter="MGrid.getImage"  >身份证反面照</th>
						<th data-field="authLicensePhoto" data-formatter="MGrid.getImage"  >营业执照照片</th>
						<th data-field="authLicenseType" data-formatter="authType"  >认证类型</th>
						<th data-align="center"  data-width="150px" data-field="id" data-formatter="buidOperate">操作</th>
					</tr>
				</thead>
			</table>
	</div>
	</div>
</div>
</div>
<script type="text/javascript"
src="${path }/resource/js/systools/MJsBase.js"></script>
<script type="text/javascript">
	
	var myGrid;
	
		$(function(){
			var delPath="";
			delPath="${path}/do/bizAuth/del";
			 myGrid=MGrid.initGrid({
				 url:"${path}/do/bizAuth/showList",
				 delUrl:delPath
			 });
			 
			 
			 
		});
		function authType(value, row, index){
			if(value==1){
				return '个人认证';
			}else{
				return '企业认证';
			}
		}
		function authStatus(value, row, index){
			if(value==1){
				return '待审核';
			}else if(value==2){
				return '审核通过';
			}else if(value==3){
				return '审核失败';
			}
		}
		function buidOperate(value, row, index){
			var html=[];
			html[0]='<a onClick="openEdit(\''+value+'\')"  title="编辑" class="fa fa-edit option"></a>'
			
			html[3]='<a onClick="myGrid.delItem(\''+value+'\')" title="删除" class="fa fa-close option text-danger"></a>';
			
			return html.join(""); 
		}
		 
		//打开编辑界面
		function openEdit(id) {
			layer.open({
				type : 2,
				title : "编辑认证信息",
				area : [ MUI.SIZE_L, '500px' ],
				maxmin : true,
				content : [ '${path}/do/bizAuth/editForm?id=' + id]
			});
		}
 
	</script>
</body>
</html>
